1. Technical Field
The present invention relates generally to compiling and, in particular, to obtaining correct compile results by absorbing mismatches between data type representations when different compilers are combined.
2. Description of the Related Art
After converting a type in a domain-specific language (DSL) to a corresponding type in an existing compiler (e.g., a ROSE compiler), when a field access or a method invocation that is not defined in the existing compiler exists, the compilation will fail because the field or the method does not exist in the converted type in the existing compiler.
For example, it may be necessary to convert an abstract syntax tree (AST) that is created by the DSL compiler to an AST of the existing compiler. However, simply converting an AST as per the prior art not only disables the optimization support of the existing compiler but also causes compilation errors. For example, there is a mismatch of data type representations between the two compilers. Consider the following two examples involving a ROSE compiler and an X10 compiler. In the first example, to represent the type for an integer value, X10 uses an object type “x10.lang.Int”, while in contrast ROSE uses the primitive type “int”. In the second example, to represent the type for an array of integers, X10 uses “x10.lang.Rail[x10.lang.Int]”, while in contrast ROSE uses “int[ ]”. Also, there are different functions between these corresponding classes.
Thus, there is a need for obtaining correct compile results by absorbing the mismatch between data type representations when different compilers are combined.